import { cookies } from 'next/headers'
import Hero from '../../components/hero'
import { fetcher } from '@/src/utils/fetcher'
import { useImagePlaceholder } from '../../hooks/useImagePlaceholder'
import { getTranslations } from 'next-intl/server'

const Page: React.FC = async () => {
  const cookieStore = cookies()

  const [t, sliders] = await Promise.all([
    // 翻译
    getTranslations('home'),
    // 请求轮播图
    fetcher<Slider[]>('/api/index/adList?type=home', {
      cookieStore,
    }),
  ])

  return <Hero isHome sliders={sliders} buttonLabel={t('discoverMore')} />
}

export default Page
